<!DOCTYPE html>
<html>

<head>
    <title>我的评论</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/travel.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="../js/common.js"></script>
    <script>
        $(function () {
            //获取当前的登录用户的Id
            var user = JSON.parse(sessionStorage.getItem("user"));
            //获取每个类型的消息统计
            $.get("/messages/"+user.id+"/oneComment",function (data) {
                console.log(data);
                $.each(data,function (index,ele) {
                    console.log(ele.count);
                    $("span[data-typeId="+ele.typeId+"]").html(ele.count)
                })
            })

            $(".pengyou").click(function () {
                var url = $(this).data("url");
                $(this).attr("href",url+user.id);
            })
        })
    </script>
</head>

<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col">
            <a href="javascript:window.history.go(-1)">
                <span><i class="fa fa-chevron-left"></i></span>
            </a>
        </div>
        <div class="col">
            <span>我的评论</span>
        </div>
        <div class="col"></div>
    </div>
</div>

<ul class="list-group">
    <a  href="/mine/myCollects.html?type=2">
        <li class="list-group-item d-flex justify-content-between align-items-center">
            <div class="item">
                <span><i class="fa fa-plane"></i></span>
                <span>攻略</span>
                <span class="badge badge-danger badge-pill" data-typeId="2"></span>
            </div>
            <i class="fa fa-chevron-right"></i>
        </li>
    </a>
    <a  href="/mine/myCollects.html?type=1">
        <li class="list-group-item d-flex justify-content-between align-items-center">
            <div class="item">
                <span><i class="fa fa-book"></i></span>
                <span>游记</span>
                <span class="badge badge-danger badge-pill" data-typeId="1"></span>
            </div>
            <i class="fa fa-chevron-right"></i>
        </li>
    </a>
    <a href="/mine/myCollects.html?type=3" data-type="3">
        <li class="list-group-item d-flex justify-content-between align-items-center">
            <div class="item">
                <span><i class="fa fa-newspaper-o"></i>	</span>
                <span>日报</span>
                <span class="badge badge-danger badge-pill" data-typeId="3"></span>
            </div>
            <i class="fa fa-chevron-right"></i>
        </li>
    </a>
    <a class="pengyou" data-url="/mine/myMomentsDynamic.html?userId=">
        <li class="list-group-item d-flex justify-content-between align-items-center">
            <div class="item">
                <span><i class="fa fa-recycle"></i>	</span>
                <span>朋友圈</span>
                <span class="badge badge-danger badge-pill" data-typeId="5"></span>
            </div>
            <i class="fa fa-chevron-right"></i>
        </li>
    </a>
</ul>
</body>

</html>